package com.vmc.model;

import java.io.File;

import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

public abstract class AbstractTransferDetail {
	protected static final String FORMAT = "%s" + File.separator + "%s.%s";

	private String title;
	private String extension;
	private String location;
	private String sourceFilename;
	private DetailType type;
	
	public AbstractTransferDetail(String title, String extension,
			String location, String sourceFilename, DetailType type) {
		super();
		this.title = title;
		this.extension = extension;
		this.location = location;
		this.sourceFilename = sourceFilename;
		this.type = type;
	}
	
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public String getExtension() {
		return extension;
	}
	public void setExtension(String extension) {
		this.extension = extension;
	}
	public String getLocation() {
		return location;
	}
	public void setLocation(String location) {
		this.location = location;
	}
	public String getSourceFilename() {
		return sourceFilename;
	}
	public void setSourceFilename(String sourceFilename) {
		this.sourceFilename = sourceFilename;
	}
	public DetailType getType() {
		return type;
	}
	public void setType(DetailType type) {
		this.type = type;
	}
	
	@Override
	public String toString() {
		return ReflectionToStringBuilder.toString(this, ToStringStyle.MULTI_LINE_STYLE);
	}
	
	public boolean isFile(String filename) {
		return (filename != null && this.getSourceFilename() != null && filename.equalsIgnoreCase(this.getSourceFilename()));
	}
	
	public abstract String getDestinationFilePath();
}
